]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier : Fix delayed variables checking
authorJerome Brenier <j.brenier@ik.me>
Thu, 10 Apr 2025 18:04:22 +0000 (20:04 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 11 Apr 2025 10:09:21 +0000 (12:09 +0200)
A type-safe comparision against null can be incorrectly positive with never initialized
variables (undefined).
As spotted in https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3688#note_2407551,
allowing for type coercion avoids this situation.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7854
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3688>

js/ui/magnifier.js

index 017451cc3e2b394e9e1ea3a77d312b9ab0a3057d..3b5c011a7b39048aeffa9594cea10e6a7fa30f68 100644 (file)
@@ -1280,7 +1280,7 @@ class ZoomRegion {
         this._clearScrollContentsTimer();
         this._scrollContentsTimerId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, POINTER_REST_TIME, () => {
             this._followingCursor = false;
-            if (this._xDelayed !== null && this._yDelayed !== null) {
+            if (this._xDelayed != null && this._yDelayed != null) {
                 this._scrollContentsToDelayed(this._xDelayed, this._yDelayed);
                 this._xDelayed = null;
                 this._yDelayed = null;